@using Microsoft.Extensions.Options
@using Volo.Abp.AspNetCore.Components.Web.Theming.Routing
@inject IOptions<AbpRouterOptions> RouterOptions
<Blazorise.ThemeProvider Theme="@theme">
    <CascadingAuthenticationState>
        <Router AppAssembly="RouterOptions.Value.AppAssembly"
                AdditionalAssemblies="RouterOptions.Value.AdditionalAssemblies">
            <Found Context="routeData">
                <AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
                    <NotAuthorized>
                        @if (!context.User.Identity.IsAuthenticated)
                        {
                            <RedirectToLogin />
                        }
                        else
                        {
                            <p>You are not authorized to access this resource.</p>
                        }
                    </NotAuthorized>
                </AuthorizeRouteView>
            </Found>
            <NotFound>
                <LayoutView Layout="@typeof(MainLayout)">
                    <p>Sorry, there's nothing at this address.</p>
                </LayoutView>
            </NotFound>
        </Router>
    </CascadingAuthenticationState>
    <MessageAlert />

</Blazorise.ThemeProvider>
@code{
    static string primary = "#0d6efd";
    static string secondary = "#a5a5a5";
    private Theme theme = new()
    {
        BarOptions = new()
        {
            VerticalWidth="256px",
            HorizontalHeight = "64px",
            LightColors = new()
            {
                ItemColorOptions = new()
                {
                    ActiveBackgroundColor = "#dedede",
                    HoverBackgroundColor = "#dedede"
                },
                DropdownColorOptions=new()
                {                    
                    BackgroundColor="#fff"
                }
            }
        },
        BackgroundOptions = new()
        {
            Primary = primary,
            Secondary = secondary,
        }
    };
}
